from __future__ import annotations
from abc import ABC, abstractmethod
from typing import List


class Subject(ABC):
    def __init__(self):
        self._observers: List[Observer] = []
        self._changed = False

    def register_observer(self, observer: Observer):
        if observer not in self._observers:
            self._observers.append(observer)

    def remove_observer(self, observer: Observer):
        if observer in self._observers:
            self._observers.remove(observer)

    @abstractmethod
    def notify_observers(self):
        ...

    def set_change(self):
        self._changed = True


class Observer(ABC):
    @abstractmethod
    def update(self, temp: float, humidity: float, pressure: float):
        ...

